<?php
namespace common\modules\mapp\models;

use Yii;

/**
 * This is the model class for table "{{%mapp_version_upgrade}}".
 *
 * @property integer $id
 * @property integer $app_id
 * @property integer $version_major
 * @property integer $version_mini
 * @property string $version_code
 * @property string $download_url
 * @property integer $upgrade_type
 * @property string $upgrade_hint
 * @property integer $status
 * @property integer $created_by
 * @property integer $created_at
 */
class MappVersionUpgrade extends \yii\db\ActiveRecord
{

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%mapp_version_upgrade}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [
                [
                    'app_id',
                    'version_major',
                    'version_mini',
                    'upgrade_type',
                    'status',
                    'created_by',
                    'created_at'
                ],
                'integer'
            ],
            [
                [
                    'version_code'
                ],
                'string',
                'max' => 10
            ],
            [
                [
                    'download_url',
                    'upgrade_hint'
                ],
                'string',
                'max' => 255
            ]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'app_id' => '应用ID',
            'version_major' => '大版本',
            'version_mini' => '小版本',
            'version_code' => '版本标识',
            'download_url' => '下载地址',
            'upgrade_type' => '更新类型',
            'upgrade_hint' => '更新提示',
            'status' => '状态',
            'created_by' => '创建人',
            'created_at' => '创建时间'
        ];
    }

    /**
     * @inheritdoc
     *
     * @return \common\modules\mapp\models\query\MappVersionUpgradeQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \common\modules\mapp\models\query\MappVersionUpgradeQuery(get_called_class());
    }
}
